<html>
<body>

This example shows the use of a contract between different methods. In this case, the contract is between equals and hashCode. 
See http://docs.oracle.com/javase/6/docs/api/java/lang/Object.html#hashCode() for details.
The Point2D_* classes are all the same, except their implementations of hashCode. The implementation is Point2D_1 is incorrect. 
HashMapTests demonstrates the consequences this can have on a program: a map lookup fails where we expect it to succeed. 

<p/>

To run the program, execute HashMapTests using a JUnit test runner (in Eclipse, use Run As > JUnit Test). 

<p/>
&copy; Jens Dietrich, 2012

</body>
</html>